.fileTree {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--color-text-primary);
  overflow: hidden;
}


.fileList {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.fileItem {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  cursor: pointer;
  border-radius: 0;
  transition: all var(--transition-fast);
  position: relative;
  min-height: 32px;
  outline: none;
  user-select: none;
  background: transparent;
  border-left: 2px solid transparent;
}

.fileItem:hover {
  background: var(--color-bg-hover, #f8f9fa);
  border-left-color: var(--color-text-secondary, #6c757d);
}

.fileItem:focus-visible {
  background: var(--color-bg-hover, #f8f9fa);
  border-left-color: var(--color-primary, #3b82f6);
}

.fileItem.active {
  background: var(--color-primary-bg, #e3f2fd);
  color: var(--color-primary, #3b82f6);
  border-left-color: var(--color-primary, #3b82f6);
  font-weight: 500;
}

.fileItem.active:hover {
  background: var(--color-primary-bg-hover, #bbdefb);
}

.fileIcon {
  margin-right: 8px;
  font-size: 16px;
  min-width: 16px;
  text-align: center;
}

.folderIcon {
  margin-right: 8px;
  font-size: 16px;
  min-width: 16px;
  text-align: center;
  color: var(--color-warning, #ffc107);
  opacity: 0.9;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.folderIcon:hover {
  opacity: 1;
  transform: scale(1.05);
  transition: all 0.2s ease;
}

.expandButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.expandButton:hover {
  background: var(--color-bg-hover, #f8f9fa);
}

.expandIcon {
  font-size: 10px;
  color: var(--color-text-secondary, #6c757d);
  transition: transform 0.2s ease;
}

.folderItem {
  font-weight: 600;
  background: linear-gradient(135deg, var(--color-bg-tertiary, #f1f5f9) 0%, var(--color-bg-secondary, #e2e8f0) 100%);
  border-left: 4px solid var(--color-warning, #ffc107);
  border-radius: 4px;
  margin: 1px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
}

.folderItem::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-warning, #ffc107);
  opacity: 0.3;
}

.folderItem:hover {
  background: linear-gradient(135deg, var(--color-bg-hover, #e2e8f0) 0%, var(--color-bg-primary, #d1d5db) 100%);
  transform: translateX(2px);
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.folderItem.active {
  background: linear-gradient(135deg, var(--color-primary-bg, #e3f2fd) 0%, var(--color-primary-light, #bbdefb) 100%);
  border-left-color: var(--color-primary, #3b82f6);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.folderItem.active::before {
  background: var(--color-primary, #3b82f6);
  opacity: 0.6;
}

.fileName {
  flex: 1;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.dirtyIndicator {
  margin-left: 8px;
  color: var(--color-warning);
  font-size: 12px;
  font-weight: bold;
  opacity: 0.8;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.emptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 32px 16px;
  text-align: center;
  color: var(--color-text-tertiary);
}

.emptyIcon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.emptyText {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--color-text-secondary);
}

.emptyHint {
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.8;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .fileItem {
    padding: 10px 12px;
    min-height: 40px;
  }
  
  .fileIcon {
    font-size: 14px;
    margin-right: 6px;
  }
  
  .fileName {
    font-size: 14px;
  }
  
  .emptyState {
    padding: 24px 12px;
  }
  
  .emptyIcon {
    font-size: 40px;
    margin-bottom: 12px;
  }
  
  .emptyText {
    font-size: 15px;
  }
  
  .emptyHint {
    font-size: 12px;
  }
}

/* 文件操作区样式 */
.fileActions {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
}

.fileItem:hover .fileActions,
.fileItem.active .fileActions {
  opacity: 1;
}

.fileActions .actionButton {
  padding: 6px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--color-text-secondary, #6c757d);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fileActions .actionButton:hover {
  background: var(--color-bg-hover, #f8f9fa);
  color: var(--color-text-primary, #212529);
  border-color: var(--color-border-secondary, #e9ecef);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fileActions .actionButton:active {
  background: var(--color-bg-active, #e9ecef);
  border-color: var(--color-border-primary, #dee2e6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

@media (max-width: 480px) {
  .fileItem {
    padding: 8px 10px;
    min-height: 36px;
  }
  
  .fileIcon {
    font-size: 13px;
    margin-right: 5px;
  }
  
  .fileName {
    font-size: 13px;
  }
  
  .emptyIcon {
    font-size: 36px;
  }
  
  .emptyText {
    font-size: 14px;
  }
}

/* 遮罩层样式 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 背景遮罩 */
.mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease-out;
  z-index: 9998;
}

.dialog {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  min-width: 320px;
  max-width: 90vw;
  max-height: 90vh;
  animation: slideIn 0.2s ease-out;
  overflow: hidden;
  position: relative;
  z-index: 10000;
  pointer-events: auto;
}

.dialogHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-secondary);
  background: var(--color-bg-secondary);
}

.dialogHeader h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.closeButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: var(--border-radius-sm);
  color: var(--color-text-tertiary);
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all var(--transition-fast);
  outline: none;
}

.closeButton:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.dialogBody {
  padding: 20px;
}

.dialogBody p {
  margin: 0 0 12px 0;
  color: var(--color-text-primary);
  line-height: 1.5;
}

.warningText {
  color: var(--color-warning) !important;
  font-size: 13px;
  margin-bottom: 0 !important;
}

.fileNameInput {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition-fast);
  outline: none;
}

.fileNameInput:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-alpha);
}

.fileNameInput::placeholder {
  color: var(--color-text-tertiary);
}

.dialogFooter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--color-border-secondary);
  background: var(--color-bg-secondary);
}

.cancelButton,
.confirmButton {
  padding: 8px 16px;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  min-width: 68px;
}

.cancelButton {
  background: transparent;
  color: var(--color-text-secondary);
}

.cancelButton:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.confirmButton {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.confirmButton:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.confirmButton:disabled {
  background: var(--color-bg-disabled);
  color: var(--color-text-disabled);
  border-color: var(--color-border-secondary);
  cursor: not-allowed;
}

.confirmButton.danger {
  background: var(--color-error);
  border-color: var(--color-error);
}

.confirmButton.danger:hover {
  background: var(--color-error-hover);
  border-color: var(--color-error-hover);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 移动端对话框适配 */
@media (max-width: 768px) {
  .dialog {
    min-width: 280px;
    max-width: calc(100vw - 32px);
    width: 100%;
    margin: 0;
  }
  
  .dialogHeader {
    padding: 14px 16px;
  }
  
  .dialogHeader h3 {
    font-size: 15px;
  }
  
  .dialogBody {
    padding: 16px;
  }
  
  .dialogFooter {
    padding: 14px 16px;
    gap: 10px;
  }
  
  .fileNameInput {
    padding: 12px;
    font-size: 16px; /* 防止iOS缩放 */
  }
}

@media (max-width: 480px) {
  .dialog {
    min-width: 260px;
    max-width: calc(100vw - 24px);
    width: 100%;
    margin: 0;
  }
  
  .dialogHeader {
    padding: 12px 14px;
  }
  
  .dialogBody {
    padding: 14px;
  }
  
  .dialogFooter {
    padding: 12px 14px;
    flex-direction: column-reverse;
    gap: 8px;
  }
  
  .cancelButton,
  .confirmButton {
    width: 100%;
    min-width: auto;
  }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
  .dialog {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  }
  
  .fileActions .actionButton {
    background: transparent;
    border-color: transparent;
    color: var(--color-text-secondary, #a0aec0);
  }
  
  .fileActions .actionButton:hover {
    background: var(--color-hover, #4a5568);
    color: var(--color-text-primary, #e2e8f0);
    border-color: var(--color-border-secondary, #718096);
  }
  
  .fileActions .actionButton:active {
    background: var(--color-active, #2d3748);
    border-color: var(--color-border-primary, #4a5568);
  }
  
  .folderIcon {
    color: #ffc107;
  }
  
  .expandButton:hover {
    background: var(--color-hover, #4a5568);
  }
  
  .expandIcon {
    color: var(--color-text-secondary, #a0aec0);
  }
  
  .folderItem:hover {
    background: var(--color-hover, #4a5568);
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .dialog {
    border: 2px solid var(--color-border-primary);
  }
  
  .fileNameInput:focus {
    box-shadow: 0 0 0 3px var(--color-primary);
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .overlay,
  .dialog {
    animation: none;
  }
}
